<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<button onclick="div1.style.width=300 + 'px';div1.style.height=300 + 'px'" id='btn1'>我是一个普通按钮</button>
<div id="div1"></div>
<script type="text/javascript">
//innerHTML:元素内容；
btn1.style.width=300 + 'px';
btn1.style.Height=300 + 'px';
var red=Math.floor(Math.random()*256);
var green=Math.floor(Math.random()*256);
var blue=Math.floor(Math.random()*256);
console.log(red);
console.log(green);
console.log(blue);
div1.style.backgroundColor = 'rgb('+red+','+green+','+blue+')';

</script>
</body>
</html>